package com.suncnpap.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.app.util.database.mybatis.Page;
import com.suncnpap.system.service.GroupTypeService;
import com.suncnpap.system.mapper.AdminMapper;
import com.suncnpap.system.mapper.GroupTypeMapper;
import com.suncnpap.system.model.GroupType;

/** 
 * 说明： 组别Service实现类
 * @version
 */
@Service("groupTypeService")
public class GroupTypeServiceImpl implements GroupTypeService{

	
	@Autowired
	GroupTypeMapper groupTypeMapper;
	
	@Autowired
	AdminMapper adminMapper;
	
	@Override
	public void add(GroupType obj) {
		// TODO Auto-generated method stub
		groupTypeMapper.add(obj);
	}

	@Override
	public void update(GroupType obj) {
		// TODO Auto-generated method stub
		groupTypeMapper.edit(obj);
		adminMapper.updateByGroupTypeId(obj.getStrId(), obj.getStrGroupName(), obj.getStrSchoolId());
	}

	@Override
	public void deleteById(String strId) {
		// TODO Auto-generated method stub
		groupTypeMapper.deleteById(strId);
		
	}
	@Override
	public void deleteMore(String[] strIds) {
		// TODO Auto-generated method stub
		groupTypeMapper.deleteMore(strIds);
	}

	@Override
	public Page list(Page page) {
		// TODO Auto-generated method stub
		List<GroupType> list = groupTypeMapper.datalistPage(page);
		page.setDataList(list);
		return page;
	}


	@Override
	public int findCount(Page page) {
		// TODO Auto-generated method stub
		return groupTypeMapper.findCount(page);
	}

	@Override
	public GroupType findById(String strId) {
		// TODO Auto-generated method stub
		return groupTypeMapper.findById(strId);
	}
	
}

